package net.form.processing;

import java.util.List;

import net.model.RasgoClase;

public class KMeansOfObjectDiameter extends KMeansOfObject {

	public KMeansOfObjectDiameter(HSVRangeBackground rangeFondo,
			List<ObjetoClasificadorKmeans> objetos, int heft, List<RasgoClase> rasgo) {
		super(rangeFondo, objetos, heft, rasgo);
	}

//	@Override
//	public double getValue(ObjetoClasificadorKmeans obj) {
//		return obj.getDiametro();
//	}

	@Override
	public Cluster initializeCluster(int id, int heft, double valor) {
		return new ClusterDiameter(id, heft, valor);
	}

	public Cluster[] createClusters( int k) {
		// Here the clusters are taken with specific steps,
		// so the result looks always same with same image.
		// You can randomize the cluster centers, if you like.
		Cluster[] result = new Cluster[6];
		//Valores fijo y por defecto por si no se encuentra en la BD.
		result[0] = initializeCluster(0, this.heft, 12.297653045410378);
		result[1] = initializeCluster(1, this.heft, 9.479109090241026);
		result[2] = initializeCluster(2, this.heft, 3.0283676628747926);
		result[3] = initializeCluster(3, this.heft, 5.207731534198162);
		result[4] = initializeCluster(4, this.heft, 3.993868933104304);
		result[5] = initializeCluster(5, this.heft,0 );
		return completeClusters(result);
	}
}
